package route

import (
	"forum/app/controller/api/cate"
	"forum/app/controller/api/index"
	"forum/app/controller/api/note"
	"forum/app/controller/api/user"
	"net/http"
)

func InitApi() {
	//首页
	http.HandleFunc("/api/index/home", index.Home)

	//用户模块
	http.HandleFunc("/api/user/login", user.Login)
	http.HandleFunc("/api/user/register", user.Register)
	http.HandleFunc("/api/user/getUserInfo", user.GetUserInfo)
	http.HandleFunc("/api/user/updateUserInfo", user.UpdateUserInfo)
	http.HandleFunc("api/user/levelUp", user.LevelUp)
	http.HandleFunc("/api/user/logout", user.Logout)

	//分类模块
	http.HandleFunc("api/cate/list", cate.GetList)
	http.HandleFunc("api/cate/detail", cate.GetDetail)
	http.HandleFunc("api/cate/create", cate.Create)
	http.HandleFunc("api/cate/update", cate.Update)
	http.HandleFunc("api/cate/delete", cate.Delete)

	//帖子模块
	http.HandleFunc("/api/note/list", note.GetList)
	http.HandleFunc("/api/note/detail", note.GetDetail)
	http.HandleFunc("/api/note/create", note.Create)
	http.HandleFunc("/api/note/update", note.Update)
	http.HandleFunc("/api/note/delete", note.Delete)

	// //好友模块
	// http.HandleFunc("/api/friend/create", friend.Create())
	// http.HandleFunc("/api/friend/update", friend.Update())
	// http.HandleFunc("/api/friend/agree", friend.Agree())

	// //任务模块
	// http.HandleFunc("api/task/list", task.GetList())
	// http.HandleFunc("/api/task/detail", task.GetDetail())
	// http.HandleFunc("/api/task/over", task.Over())
}
